import Vue from 'vue';
import App from './App.vue';
import router from './router';
import ElementUI, { Form } from 'element-ui';
import VueI18n from 'vue-i18n';
import { messages } from './components/common/i18n';
// import 'element-ui/lib/theme-chalk/index.css'; // 默认主题
import './assets/css/theme-green/index.css'; // 浅绿色主题
import './assets/css/icon.css';
import './components/common/directives';
import 'babel-polyfill';
import axios from "axios";
import XLSX from 'xlsx'
import Qs from 'qs'
import store from './store'
import $moment from 'moment';
// dialog拖拽全屏缩放
import Drag from '@/utils/drag.js'


Vue.use($moment);
Vue.prototype.$moment = $moment;

//import css
import 'vue-beauty/package/style/vue-beauty.min.css'

//import components

import vueBeauty from 'vue-beauty'
Vue.prototype.XLSX = XLSX
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
Vue.config.productionTip = false;

Vue.prototype.$axios = axios;


// 垃圾积分
// http://192.168.1.113:6607/
// http://111.160.78.62:9942/GarbagePointsApi/
// http://111.160.78.62:9943/GarbagePointsBDEApi/
// http://111.160.78.62:5575/GarbagePointsTYApi/
// http://111.160.78.62:5578/GarbagePointsFJApi/ //登陆添加‘佳好佳’
// http://111.160.78.62:5579/GarbagePointsBJApi/

Vue.prototype.$urlBase =  'http://111.160.78.62:9943/'; //基本信息接口
Vue.prototype.$url =  'http://111.160.78.62:9943/GarbagePointsBDEApi/BasicData'; //基本信息接口
Vue.prototype.$surl = 'http://111.160.78.62:9943/GarbagePointsBDEApi/Statistics'; //称重接口
Vue.prototype.$iurl = 'http://111.160.78.62:9943/GarbagePointsBDEApi/Integral'; //积分接口
Vue.prototype.$rurl = 'http://111.160.78.62:9943/GarbagePointsBDEApi/Role' // 权限接口
Vue.prototype.$aurl = 'http://111.160.78.62:9943/GarbagePointsBDEApi/AppointmentApp' // 权限接口
Vue.prototype.qs = Qs
Vue.use(VueI18n);
Vue.use(vueBeauty)
Vue.use(ElementUI, {
    size: 'small'
});
const i18n = new VueI18n({
    locale: 'zh',
    messages
});



//使用钩子函数对路由进行权限跳转
router.beforeEach((to,from,next)=>{
    // document.title = `${to.meta.title} | 街镇整体居民及机构垃圾分类工作管理平台`;
    next()
})

new Vue({
    router,
    i18n,
    store,
    render: h => h(App)
}).$mount('#app');
